package ch09.shili;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;

//字符输入流
public class S07 {

    public static void main(String[] args) {
        try(Reader reader = new FileReader("data/test3.txt")){
            while (true){
                int word = reader.read();
                if(word == -1){
                    break;
                }
                char c = (char)word;
                System.out.println(c+"\t"+word);
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
